<template>
<div>
  <h1>
    个人中心
  </h1>
  <ul style="list-style-type: none">
    <li>姓名:{{info.name}}</li>
    <li v-if="info.sex===1">性别:男</li>
    <li v-else>性别：女</li>
    <li>院系：{{info.department}}</li>
    <li>地址：{{info.address}}</li>
    <li>班级：{{info.classes}}</li>
  </ul>
</div>
</template>

<script>
export default {
  data(){
    return {
      studentName:global.username,
      info:""
    }
  },
  created() {
    this.getScore();
  },
  methods: {
    getScore() {
      this.$http.get('student/info', {
        params: {
          id: this.studentName
        }
      }).then(
          res => {
            this.info = res.data.data;
          }, res => {
            console.log(res.state);
          })
    },
  }
}
</script>

<style scoped>

</style>